<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <home-page></home-page>
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp, h } = Vue;
    const app = createApp();
    const HomePage = {
      /* 
        render函数要求 返回组件虚拟dom
        vue提供了一个渲染函数 h 函数调用 自动生成虚拟dom
      */
      render: () => {
        return h('div', {class:['a', 'box'],id:"wrap"}, [
          h('p', {}, ['这是p']),
          h('span', {}, ['这是span']),
          '文本内容'
        ])
      }
    }
    app.component('HomePage', HomePage);
    app.mount('#app')
  </script>
</body>
</html>